Component({
    properties: {
        myVisible: {
            type: Boolean,
            value: !1,
            observer: "_visibleChange"
        }
    },
    data: {
        visible: !1,
        animation: null,
        animationData: null
    },
    ready: function() {
        var t = wx.createAnimation({
            duration: 200,
            timingFunction: "linear",
            delay: 0
        });
        this.setData({
            animation: t
        });
    },
    methods: {
        _visibleChange: function(t, i, n) {
            !1 === i && !0 === t && setTimeout(function() {
                this._onShow();
            }.bind(this), 0);
        },
        _onShow: function() {
            var t = this;
            wx.createSelectorQuery().in(this).select("#modal-box").boundingClientRect(function(i) {
                var n = t.data.animation;
                n.translateY(-i.height).step(), t.setData({
                    visible: !0,
                    animationData: n.export()
                });
            }).exec();
        },
        _onCancel: function() {
            var t = this.data.animation;
            t.translateY(0).step(), this.setData({
                visible: !1,
                animationData: t.export()
            }), setTimeout(function() {
                this.triggerEvent("myOnCancel");
            }.bind(this), 200);
        }
    }
});